<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SPHinXsys: SPHINXsys/src/shared/simbody/array.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SPHinXsys
   &#160;<span id="projectnumber">alpha version</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_3dc1dabd28ba78e072d14d3fcfc90454.html">SPHINXsys</a></li><li class="navelem"><a class="el" href="dir_48ea983704c43b6d88c1fa3f4d09e369.html">src</a></li><li class="navelem"><a class="el" href="dir_0a0d9ef1793521534f0094f317758287.html">shared</a></li><li class="navelem"><a class="el" href="dir_a229ef5dde7e92705d3b5edc903688f9.html">simbody</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">array.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="array_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;base_data_package.h&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;cstdio&gt;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;stdexcept&gt;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> Array_CAPMIN = 1;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_s_p_h.html">SPH</a> {</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html">   27</a></span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">class </span><a class="code" href="class_s_p_h_1_1_array.html">Array</a></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    {</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="keyword">protected</span>:</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">   31</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>;</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">   33</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">   36</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a>;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">   38</a></span>&#160;        T <a class="code" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">defaultValue_</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">   40</a></span>&#160;        T *<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a0f55f554849fbf6e383296843712efab">   53</a></span>&#160;        <span class="keyword">explicit</span> <a class="code" href="class_s_p_h_1_1_array.html#a0f55f554849fbf6e383296843712efab">Array</a>(<span class="keyword">const</span> T &amp;aDefaultValue=T(),<span class="keywordtype">int</span> aSize=0,<span class="keywordtype">int</span> aCapacity=Array_CAPMIN)</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        {</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            setNull();</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">defaultValue_</a> = aDefaultValue;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;            <span class="keywordtype">int</span> newCapacity;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;            <span class="keywordtype">int</span> min = aSize + 1;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            <span class="keywordflow">if</span>(min &lt; aCapacity) min = aCapacity;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#ab42969a507590e8c8b9ac41f3420d2ed">computeNewCapacity</a>(min,newCapacity);</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a90ebe58b528b720fe21f426799f47efc">ensureCapacity</a>(newCapacity);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> = aSize;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>&lt;0) <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>=0;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        }</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a5e15f488ae2a2a5e47b74188b53af00f">   70</a></span>&#160;        <a class="code" href="class_s_p_h_1_1_array.html#a5e15f488ae2a2a5e47b74188b53af00f">Array</a>(<span class="keyword">const</span> <a class="code" href="class_s_p_h_1_1_array.html">Array&lt;T&gt;</a> &amp;aArray)</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        {</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            setNull();</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            *<span class="keyword">this</span> = aArray;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        }</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#aa13615c7285214239f0484cf46a8fead">   81</a></span>&#160;        <span class="keyword">virtual</span> <a class="code" href="class_s_p_h_1_1_array.html#aa13615c7285214239f0484cf46a8fead">~Array</a>()</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        {</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>!=NULL) { <span class="keyword">delete</span>[] <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>;  <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a> = NULL; }</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        }</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">private</span>:</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <span class="keywordtype">void</span> setNull()</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        {</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> = 0;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a> = -1;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a> = 0;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a> = NULL;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        }</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="comment">//=============================================================================</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="comment">// OPERATORS</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="comment">//=============================================================================</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#aba157e5818d4b4222c062b077d964030">  103</a></span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="class_s_p_h_1_1_array.html#aba157e5818d4b4222c062b077d964030">arrayEquals</a>(<span class="keyword">const</span> <a class="code" href="class_s_p_h_1_1_array.html">Array&lt;T&gt;</a> &amp;aArray)<span class="keyword"> const</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span> == aArray;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        }</div><div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a5c36b90a0b559e69c7850e7791794b0f">  125</a></span>&#160;        T&amp; <a class="code" href="class_s_p_h_1_1_array.html#a5c36b90a0b559e69c7850e7791794b0f">operator[]</a>(<span class="keywordtype">int</span> aIndex)<span class="keyword"> const</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[aIndex]);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        }</div><div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a79679d423f2d29a81f871c33f5461585">  137</a></span>&#160;        <a class="code" href="class_s_p_h_1_1_array.html">Array&lt;T&gt;</a>&amp; <a class="code" href="class_s_p_h_1_1_array.html#a79679d423f2d29a81f871c33f5461585">operator=</a>(<span class="keyword">const</span> <a class="code" href="class_s_p_h_1_1_array.html">Array&lt;T&gt;</a> &amp;aArray)</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        {</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> = aArray.<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a> = aArray.<a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a> = aArray.<a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a>;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">defaultValue_</a> = aArray.<a class="code" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">defaultValue_</a>;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            <span class="comment">// ARRAY</span></div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>!=NULL) <span class="keyword">delete</span>[] <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a> = <span class="keyword">new</span> T[<a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>];</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i=0;i&lt;<a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>;i++) <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i] = aArray.<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i];</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;            <span class="keywordflow">return</span>(*<span class="keyword">this</span>);</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        }</div><div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a55ade44554c3fd36477ffd67c18bcc41">  161</a></span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="class_s_p_h_1_1_array.html#a55ade44554c3fd36477ffd67c18bcc41">operator==</a>(<span class="keyword">const</span> <a class="code" href="class_s_p_h_1_1_array.html">Array&lt;T&gt;</a> &amp;aArray)<span class="keyword"> const</span></div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> != aArray.<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>) <span class="keywordflow">return</span>(<span class="keyword">false</span>);</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;            <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;            <span class="keywordflow">for</span>(i=0; i&lt;<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>; i++) </div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;            {</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;                <span class="keywordflow">if</span>( !(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i]==aArray.<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i]) ) <span class="keywordflow">return</span>(<span class="keyword">false</span>);</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;            }</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;            <span class="keywordflow">return</span>(<span class="keyword">true</span>);</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        }</div><div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a9de7cd20d4d15367196d207c9628b57b">  183</a></span>&#160;        <span class="keyword">friend</span> std::ostream&amp; operator&lt;&lt;(std::ostream &amp;aOut,const Array&lt;T&gt; &amp;aArray)</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        {</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;            <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;            <span class="keywordflow">for</span>(i=0; i&lt;aArray.getSize(); i++)  {</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;                aOut &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;                aOut &lt;&lt; aArray[i];</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;            }   </div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            <span class="keywordflow">return</span>(aOut);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        }</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        <span class="keyword">friend</span> std::istream&amp; operator&gt;&gt;(std::istream&amp; in, <a class="code" href="class_s_p_h_1_1_array.html">Array&lt;T&gt;</a>&amp; out) </div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        {    </div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;            <span class="keywordflow">return</span> in;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        }</div><div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#ab42969a507590e8c8b9ac41f3420d2ed">  219</a></span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="class_s_p_h_1_1_array.html#ab42969a507590e8c8b9ac41f3420d2ed">computeNewCapacity</a>(<span class="keywordtype">int</span> aMinCapacity,<span class="keywordtype">int</span> &amp;rNewCapacity)</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        {</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;            rNewCapacity = <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;            <span class="keywordflow">if</span>(rNewCapacity &lt; Array_CAPMIN) rNewCapacity = Array_CAPMIN;</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a> == 0) {</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot;Array.computeNewCapacity: WARN- capacity is set&quot;</span>;</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot; not to increase (i.e., capacityIncrement_==0).\n&quot;</span>;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;                <span class="keywordflow">return</span>(<span class="keyword">false</span>);</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;            }</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;            <span class="keywordflow">while</span>(rNewCapacity &lt; aMinCapacity) {</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;                <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a> &lt; 0) {</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;                    rNewCapacity = 2 * rNewCapacity;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                    rNewCapacity = rNewCapacity + <a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a>;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;                }</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;            }</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;            <span class="keywordflow">return</span>(<span class="keyword">true</span>);</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;        }</div><div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a90ebe58b528b720fe21f426799f47efc">  247</a></span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="class_s_p_h_1_1_array.html#a90ebe58b528b720fe21f426799f47efc">ensureCapacity</a>(<span class="keywordtype">int</span> aCapacity)</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;        {</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;            <span class="keywordflow">if</span>(aCapacity &lt; Array_CAPMIN) aCapacity = Array_CAPMIN;</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a> &gt;= aCapacity) <span class="keywordflow">return</span>(<span class="keyword">true</span>);</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;            <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;            T *newArray = <span class="keyword">new</span> T[aCapacity];</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;            <span class="keywordflow">if</span>(newArray == NULL) </div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;            {</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot;Array.ensureCapacity: ERR- failed to increase capacity.\n&quot;</span>;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;                <span class="keywordflow">return</span>(<span class="keyword">false</span>);</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;            }</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a> != NULL) {</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;                <span class="keywordflow">for</span>(i =0; i &lt; <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>; i++) newArray[i] = <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i];</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;                <span class="keywordflow">for</span>(i = <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>; i &lt; aCapacity; i++) newArray[i] = <a class="code" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">defaultValue_</a>;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;                <span class="keyword">delete</span> []<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>;  </div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a> = NULL;</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;            } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;                <span class="keywordflow">for</span>(i = 0; i &lt; aCapacity; i++) newArray[i] = <a class="code" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">defaultValue_</a>;</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;            }</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    </div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a> = aCapacity;</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a> = newArray;</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;            <span class="keywordflow">return</span>(<span class="keyword">true</span>);</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        }</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;</div><div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a0aef18d09f5176a772a2d57dc0dff014">  282</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_array.html#a0aef18d09f5176a772a2d57dc0dff014">trim</a>()</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;        {</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;            <span class="keywordtype">int</span> newCapacity = <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> + 1;</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;            <span class="keywordflow">if</span>(newCapacity &gt;= <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;            <span class="keywordflow">if</span>(newCapacity &lt; Array_CAPMIN) newCapacity = Array_CAPMIN;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;            <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;            T *newArray = <span class="keyword">new</span> T[newCapacity];</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;            <span class="keywordflow">if</span>(newArray==NULL) {</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot;Array.trim: ERR- unable to allocate temporary array.\n&quot;</span>;</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;                <span class="keywordflow">return</span>;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;            }</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;            <span class="keywordflow">for</span>(i = 0; i &lt; <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>; i++) newArray[i] = <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i];</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;            <span class="keyword">delete</span>[] <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>;</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a> = newArray;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a> = newCapacity;</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;        }</div><div class="line"><a name="l00306"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a1cd0fbb23aff061ccd0c458c153ecc77">  306</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#a1cd0fbb23aff061ccd0c458c153ecc77">getCapacity</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>);</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;        }</div><div class="line"><a name="l00319"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a1ec533dc68f936a6a69b20d2e7413b1c">  319</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_s_p_h_1_1_array.html#a1ec533dc68f936a6a69b20d2e7413b1c">setCapacityIncrement</a>(<span class="keywordtype">int</span> aIncrement)</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        {</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a> = aIncrement;</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;        }</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;</div><div class="line"><a name="l00327"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a0a70842105dab412fe26f39383f27748">  327</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#a0a70842105dab412fe26f39383f27748">getCapacityIncrement</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">capacityIncrement_</a>);</div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;        }</div><div class="line"><a name="l00345"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a3dd769503306a1ee0749ebfb6fe84098">  345</a></span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="class_s_p_h_1_1_array.html#a3dd769503306a1ee0749ebfb6fe84098">setSize</a>(<span class="keywordtype">int</span> aSize)</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;        {</div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;            <span class="keywordflow">if</span>(aSize == <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>) <span class="keywordflow">return</span>(<span class="keyword">true</span>);</div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;            <span class="keywordflow">if</span>(aSize &lt; 0) aSize = 0;</div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;            <span class="keywordtype">bool</span> success = <span class="keyword">true</span>;</div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;            <span class="keywordflow">if</span>(aSize &lt; <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>) </div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;            {</div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;                <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;                <span class="keywordflow">for</span>(i = (<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> - 1);i &gt;= aSize; i--) <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i] = <a class="code" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">defaultValue_</a>;</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> = aSize;</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(aSize &lt;= <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>) {</div><div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> = aSize;</div><div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;            } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;                <span class="keywordtype">int</span> newCapacity;</div><div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;                success = <a class="code" href="class_s_p_h_1_1_array.html#ab42969a507590e8c8b9ac41f3420d2ed">computeNewCapacity</a>(aSize+1, newCapacity);</div><div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;                <span class="keywordflow">if</span>(!success) <span class="keywordflow">return</span>(<span class="keyword">false</span>);</div><div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;                success = <a class="code" href="class_s_p_h_1_1_array.html#a90ebe58b528b720fe21f426799f47efc">ensureCapacity</a>(newCapacity);</div><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;                <span class="keywordflow">if</span>(success) <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> = aSize;</div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;            }</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;</div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;            <span class="keywordflow">return</span>(success);</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;        }</div><div class="line"><a name="l00372"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a204d7f808c6067eafb2194e9f0175f4c">  372</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#a204d7f808c6067eafb2194e9f0175f4c">getSize</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;        }</div><div class="line"><a name="l00377"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#ad5370bb547361018d3013c19cf2c4d06">  377</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#ad5370bb547361018d3013c19cf2c4d06">size</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_s_p_h_1_1_array.html#a204d7f808c6067eafb2194e9f0175f4c">getSize</a>();}</div><div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;</div><div class="line"><a name="l00386"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a73917f48e092c2a252514da80a76a4ca">  386</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#a73917f48e092c2a252514da80a76a4ca">append</a>(<span class="keyword">const</span> T &amp;aValue)</div><div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;        {</div><div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;            <span class="keywordflow">if</span>((<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> + 1) &gt;= <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>) {</div><div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;                <span class="keywordtype">int</span> newCapacity;</div><div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;                <span class="keywordtype">bool</span> success;</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;                success = <a class="code" href="class_s_p_h_1_1_array.html#ab42969a507590e8c8b9ac41f3420d2ed">computeNewCapacity</a>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> + 1, newCapacity);</div><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;                <span class="keywordflow">if</span>(!success) <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;                success = <a class="code" href="class_s_p_h_1_1_array.html#a90ebe58b528b720fe21f426799f47efc">ensureCapacity</a>(newCapacity);</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;                <span class="keywordflow">if</span>(!success) <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;            }</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;</div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>] = aValue;</div><div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>++;</div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;        }</div><div class="line"><a name="l00409"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#ae176d3ae769c879d7be41391c0f34eb6">  409</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#ae176d3ae769c879d7be41391c0f34eb6">append</a>(<span class="keyword">const</span> <a class="code" href="class_s_p_h_1_1_array.html">Array&lt;T&gt;</a> &amp;aArray)</div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;        {</div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;            <span class="keywordtype">int</span> i,n = aArray.<a class="code" href="class_s_p_h_1_1_array.html#a204d7f808c6067eafb2194e9f0175f4c">getSize</a>();</div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;            <span class="keywordflow">for</span>(i = 0; i &lt; n; i++) {</div><div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#a73917f48e092c2a252514da80a76a4ca">append</a>(aArray[i]);</div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;            }</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;        }</div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;</div><div class="line"><a name="l00427"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#acf6a7517bfb720f3df159d5df7e6d1eb">  427</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#acf6a7517bfb720f3df159d5df7e6d1eb">append</a>(<span class="keywordtype">int</span> aSize,<span class="keyword">const</span> T *aArray)</div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;        {</div><div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;            <span class="keywordflow">if</span>(aSize &lt; 0) <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;            <span class="keywordflow">if</span>(aArray == NULL) <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;</div><div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;            <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;            <span class="keywordflow">for</span>(i = 0;i &lt; aSize; i++) {</div><div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#a73917f48e092c2a252514da80a76a4ca">append</a>(aArray[i]);</div><div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;            }</div><div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;</div><div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;        }</div><div class="line"><a name="l00454"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a46e1225e9fdbe3f37c4f16032b81fb76">  454</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#a46e1225e9fdbe3f37c4f16032b81fb76">insert</a>(<span class="keywordtype">int</span> aIndex,<span class="keyword">const</span> T &amp;aValue)</div><div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;        {</div><div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;            <span class="keywordflow">if</span>(aIndex&lt;0) {</div><div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot;Array.insert: ERR- aIndex was less than 0.\n&quot;</span>;</div><div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;                <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;            }</div><div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;</div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;            <span class="keywordflow">if</span>(aIndex &gt;= <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>) {</div><div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#a3dd769503306a1ee0749ebfb6fe84098">setSize</a>(aIndex+1);</div><div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[aIndex] = aValue;</div><div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;                <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;            }</div><div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;</div><div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;            <span class="keywordflow">if</span>((<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> + 1) &gt;= <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>) {</div><div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;                <span class="keywordtype">int</span> newCapacity;</div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;                <span class="keywordtype">bool</span> success;</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;                success = <a class="code" href="class_s_p_h_1_1_array.html#ab42969a507590e8c8b9ac41f3420d2ed">computeNewCapacity</a>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> + 1,newCapacity);</div><div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;                <span class="keywordflow">if</span>(!success) <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;                success = <a class="code" href="class_s_p_h_1_1_array.html#a90ebe58b528b720fe21f426799f47efc">ensureCapacity</a>(newCapacity);</div><div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;                <span class="keywordflow">if</span>(!success) <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;            }</div><div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;</div><div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;            <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;            <span class="keywordflow">for</span>(i = <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>; i &gt; aIndex; i--) {</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i] = <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i-1];</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;            }</div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;</div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[aIndex] = aValue;</div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>++;</div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;</div><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;        }</div><div class="line"><a name="l00498"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a648c604ebec21a6dfd866206b62fe6c2">  498</a></span>&#160;        <span class="keywordtype">int</span> <span class="keyword">remove</span>(<span class="keywordtype">int</span> aIndex)</div><div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;        {</div><div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;            <span class="keywordflow">if</span>(aIndex &lt; 0) {</div><div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot;Array.remove: ERR- aIndex was less than 0.\n&quot;</span>;</div><div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;                <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;            }</div><div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;            <span class="keywordflow">if</span>(aIndex &gt;= <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>) {</div><div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot;Array.remove: ERR- aIndex was greater than or equal the &quot;</span>;</div><div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot;size of the array.\n&quot;</span>;</div><div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;                <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;            }</div><div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;</div><div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;            <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>--;</div><div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;            <span class="keywordflow">for</span>(i = aIndex; i &lt; <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>; i++) {</div><div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;                <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i] = <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i+1];</div><div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;            }</div><div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>] = <a class="code" href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">defaultValue_</a>;</div><div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;</div><div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>);</div><div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;        }</div><div class="line"><a name="l00528"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a493727030a591fcb8224a738dea1ac51">  528</a></span>&#160;        <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">int</span> aIndex,<span class="keyword">const</span> T &amp;aValue)</div><div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;        {</div><div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;            <span class="keywordflow">if</span>(aIndex &lt; 0) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;</div><div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;            <span class="keywordtype">bool</span> success = <span class="keyword">false</span>;</div><div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;            <span class="keywordflow">if</span>((aIndex+2) &gt;= <a class="code" href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">capacity_</a>) {</div><div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;                <span class="keywordtype">int</span> newCapacity;</div><div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;                success = <a class="code" href="class_s_p_h_1_1_array.html#ab42969a507590e8c8b9ac41f3420d2ed">computeNewCapacity</a>(aIndex+2, newCapacity);</div><div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;                <span class="keywordflow">if</span>(!success) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;                success = <a class="code" href="class_s_p_h_1_1_array.html#a90ebe58b528b720fe21f426799f47efc">ensureCapacity</a>(newCapacity);</div><div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;                <span class="keywordflow">if</span>(!success) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;            }</div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;            <a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[aIndex] = aValue;</div><div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;            <span class="keywordflow">if</span>(aIndex &gt;= <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>)  <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> = aIndex + 1;</div><div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;        }</div><div class="line"><a name="l00548"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a4b6524f2d1e862ea0e73da1ea0b050a2">  548</a></span>&#160;        T* <span class="keyword">get</span>()</div><div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;        {</div><div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>);</div><div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;        }</div><div class="line"><a name="l00558"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#ac81ea5d068e8f5951c162d8ed704a402">  558</a></span>&#160;        <span class="keyword">const</span> T* <span class="keyword">get</span>() <span class="keyword">const</span></div><div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;        {</div><div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>);</div><div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;        }</div><div class="line"><a name="l00576"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a56079ea8cd09f82bf462718e751fd5c2">  576</a></span>&#160;        <span class="keyword">const</span> T&amp; <span class="keyword">get</span>(<span class="keywordtype">int</span> aIndex) <span class="keyword">const</span></div><div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;        {</div><div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;            <span class="keywordflow">if</span>((aIndex &lt; 0) || (aIndex &gt;= <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>)) {</div><div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;                std::stringstream msg;</div><div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;                msg &lt;&lt; <span class="stringliteral">&quot;Array index out of bounds. &quot;</span> &lt;&lt; <span class="stringliteral">&quot;.&quot;</span>;</div><div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;                <span class="keywordflow">throw</span> (msg.str(),__FILE__,__LINE__);</div><div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;            }</div><div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[aIndex]);</div><div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;        }</div><div class="line"><a name="l00591"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a07ef7f34525bdc3cd6ad81ef48632c60">  591</a></span>&#160;        <span class="keyword">const</span> T&amp; <a class="code" href="class_s_p_h_1_1_array.html#a07ef7f34525bdc3cd6ad81ef48632c60">getLast</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> &lt;= 0) {</div><div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;                std::stringstream msg;</div><div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;                msg &lt;&lt; <span class="stringliteral">&quot;Array is empty. &quot;</span> &lt;&lt; <span class="stringliteral">&quot;.&quot;</span>;</div><div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;                <span class="keywordflow">throw</span> (msg.str(),__FILE__,__LINE__);</div><div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;            }</div><div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> - 1]);</div><div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;        }</div><div class="line"><a name="l00606"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a51a97a565635ad7d9787d2d441ba0e6c">  606</a></span>&#160;        T&amp; <a class="code" href="class_s_p_h_1_1_array.html#a51a97a565635ad7d9787d2d441ba0e6c">updLast</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;            <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> &lt;= 0) {</div><div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;                std::stringstream msg;</div><div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;                msg &lt;&lt; <span class="stringliteral">&quot;Array is empty. &quot;</span> &lt;&lt; <span class="stringliteral">&quot;.&quot;</span>;</div><div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;                <span class="keywordflow">throw</span> (msg.str(),__FILE__,__LINE__);</div><div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;            }</div><div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;            <span class="keywordflow">return</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> - 1]);</div><div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;        }</div><div class="line"><a name="l00623"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#ac9e04f27e5997221a7d37795a3f4e587">  623</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#ac9e04f27e5997221a7d37795a3f4e587">findIndex</a>(<span class="keyword">const</span> T &amp;aValue)<span class="keyword"> const</span></div><div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a>; i++) <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i] == aValue) <span class="keywordflow">return</span> i;</div><div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;            <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;        }</div><div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;</div><div class="line"><a name="l00637"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_array.html#a6293f335e1b9bdc21599222d76b14d7b">  637</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="class_s_p_h_1_1_array.html#a6293f335e1b9bdc21599222d76b14d7b">rfindIndex</a>(<span class="keyword">const</span> T &amp;aValue)<span class="keyword"> const</span></div><div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=<a class="code" href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">size_</a> - 1; i &gt;= 0; i--) <span class="keywordflow">if</span>(<a class="code" href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">array_</a>[i]==aValue) <span class="keywordflow">return</span> i;</div><div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;            <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;        }</div><div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;    }; </div><div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;}</div><div class="ttc" id="class_s_p_h_1_1_array_html_abbfb2dab2b98f5d2559fd39eba66e3f6"><div class="ttname"><a href="class_s_p_h_1_1_array.html#abbfb2dab2b98f5d2559fd39eba66e3f6">SPH::Array::capacityIncrement_</a></div><div class="ttdeci">int capacityIncrement_</div><div class="ttdef"><b>Definition:</b> array.h:36</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_aba157e5818d4b4222c062b077d964030"><div class="ttname"><a href="class_s_p_h_1_1_array.html#aba157e5818d4b4222c062b077d964030">SPH::Array::arrayEquals</a></div><div class="ttdeci">bool arrayEquals(const Array&lt; T &gt; &amp;aArray) const</div><div class="ttdoc">A non-operator version of operator ==. </div><div class="ttdef"><b>Definition:</b> array.h:103</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html"><div class="ttname"><a href="class_s_p_h_1_1_array.html">SPH::Array</a></div><div class="ttdef"><b>Definition:</b> array.h:27</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a73917f48e092c2a252514da80a76a4ca"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a73917f48e092c2a252514da80a76a4ca">SPH::Array::append</a></div><div class="ttdeci">int append(const T &amp;aValue)</div><div class="ttdoc">Append a value onto the array. </div><div class="ttdef"><b>Definition:</b> array.h:386</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a0a70842105dab412fe26f39383f27748"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a0a70842105dab412fe26f39383f27748">SPH::Array::getCapacityIncrement</a></div><div class="ttdeci">int getCapacityIncrement() const</div><div class="ttdoc">Get the amount by which the capacity is increased. </div><div class="ttdef"><b>Definition:</b> array.h:327</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a3dd769503306a1ee0749ebfb6fe84098"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a3dd769503306a1ee0749ebfb6fe84098">SPH::Array::setSize</a></div><div class="ttdeci">bool setSize(int aSize)</div><div class="ttdef"><b>Definition:</b> array.h:345</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a2c1568c3d36b846f3b88d64f568626ac"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a2c1568c3d36b846f3b88d64f568626ac">SPH::Array::array_</a></div><div class="ttdeci">T * array_</div><div class="ttdef"><b>Definition:</b> array.h:40</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a6293f335e1b9bdc21599222d76b14d7b"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a6293f335e1b9bdc21599222d76b14d7b">SPH::Array::rfindIndex</a></div><div class="ttdeci">int rfindIndex(const T &amp;aValue) const</div><div class="ttdef"><b>Definition:</b> array.h:637</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a07ef7f34525bdc3cd6ad81ef48632c60"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a07ef7f34525bdc3cd6ad81ef48632c60">SPH::Array::getLast</a></div><div class="ttdeci">const T &amp; getLast() const</div><div class="ttdef"><b>Definition:</b> array.h:591</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_acf6a7517bfb720f3df159d5df7e6d1eb"><div class="ttname"><a href="class_s_p_h_1_1_array.html#acf6a7517bfb720f3df159d5df7e6d1eb">SPH::Array::append</a></div><div class="ttdeci">int append(int aSize, const T *aArray)</div><div class="ttdoc">Append an array of values. </div><div class="ttdef"><b>Definition:</b> array.h:427</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a0f55f554849fbf6e383296843712efab"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a0f55f554849fbf6e383296843712efab">SPH::Array::Array</a></div><div class="ttdeci">Array(const T &amp;aDefaultValue=T(), int aSize=0, int aCapacity=Array_CAPMIN)</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> array.h:53</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a1ec533dc68f936a6a69b20d2e7413b1c"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a1ec533dc68f936a6a69b20d2e7413b1c">SPH::Array::setCapacityIncrement</a></div><div class="ttdeci">void setCapacityIncrement(int aIncrement)</div><div class="ttdoc">Set the amount by which the capacity is increased when the capacity of of the array in exceeded...</div><div class="ttdef"><b>Definition:</b> array.h:319</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_acac68e9be5595c845f00727f60d97562"><div class="ttname"><a href="class_s_p_h_1_1_array.html#acac68e9be5595c845f00727f60d97562">SPH::Array::size_</a></div><div class="ttdeci">int size_</div><div class="ttdef"><b>Definition:</b> array.h:31</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a5e15f488ae2a2a5e47b74188b53af00f"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a5e15f488ae2a2a5e47b74188b53af00f">SPH::Array::Array</a></div><div class="ttdeci">Array(const Array&lt; T &gt; &amp;aArray)</div><div class="ttdoc">Copy constructor. </div><div class="ttdef"><b>Definition:</b> array.h:70</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a204d7f808c6067eafb2194e9f0175f4c"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a204d7f808c6067eafb2194e9f0175f4c">SPH::Array::getSize</a></div><div class="ttdeci">int getSize() const</div><div class="ttdoc">Get the size of the array. </div><div class="ttdef"><b>Definition:</b> array.h:372</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_aa13615c7285214239f0484cf46a8fead"><div class="ttname"><a href="class_s_p_h_1_1_array.html#aa13615c7285214239f0484cf46a8fead">SPH::Array::~Array</a></div><div class="ttdeci">virtual ~Array()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> array.h:81</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a51a97a565635ad7d9787d2d441ba0e6c"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a51a97a565635ad7d9787d2d441ba0e6c">SPH::Array::updLast</a></div><div class="ttdeci">T &amp; updLast() const</div><div class="ttdef"><b>Definition:</b> array.h:606</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a9961bcd37a4247cbdc4c58eff0e53656"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a9961bcd37a4247cbdc4c58eff0e53656">SPH::Array::defaultValue_</a></div><div class="ttdeci">T defaultValue_</div><div class="ttdef"><b>Definition:</b> array.h:38</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a0aef18d09f5176a772a2d57dc0dff014"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a0aef18d09f5176a772a2d57dc0dff014">SPH::Array::trim</a></div><div class="ttdeci">void trim()</div><div class="ttdef"><b>Definition:</b> array.h:282</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_ab42969a507590e8c8b9ac41f3420d2ed"><div class="ttname"><a href="class_s_p_h_1_1_array.html#ab42969a507590e8c8b9ac41f3420d2ed">SPH::Array::computeNewCapacity</a></div><div class="ttdeci">bool computeNewCapacity(int aMinCapacity, int &amp;rNewCapacity)</div><div class="ttdoc">Compute a new capacity that is at least as large as a specified minimum capacity; this method does no...</div><div class="ttdef"><b>Definition:</b> array.h:219</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_ac9e04f27e5997221a7d37795a3f4e587"><div class="ttname"><a href="class_s_p_h_1_1_array.html#ac9e04f27e5997221a7d37795a3f4e587">SPH::Array::findIndex</a></div><div class="ttdeci">int findIndex(const T &amp;aValue) const</div><div class="ttdef"><b>Definition:</b> array.h:623</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a46e1225e9fdbe3f37c4f16032b81fb76"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a46e1225e9fdbe3f37c4f16032b81fb76">SPH::Array::insert</a></div><div class="ttdeci">int insert(int aIndex, const T &amp;aValue)</div><div class="ttdoc">Insert a value into the array at a specified index. </div><div class="ttdef"><b>Definition:</b> array.h:454</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_ad5370bb547361018d3013c19cf2c4d06"><div class="ttname"><a href="class_s_p_h_1_1_array.html#ad5370bb547361018d3013c19cf2c4d06">SPH::Array::size</a></div><div class="ttdeci">int size() const</div><div class="ttdef"><b>Definition:</b> array.h:377</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a90ebe58b528b720fe21f426799f47efc"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a90ebe58b528b720fe21f426799f47efc">SPH::Array::ensureCapacity</a></div><div class="ttdeci">bool ensureCapacity(int aCapacity)</div><div class="ttdoc">Ensure that the capacity of this array is at least the specified amount. Note that the newly allocate...</div><div class="ttdef"><b>Definition:</b> array.h:247</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a1cd0fbb23aff061ccd0c458c153ecc77"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a1cd0fbb23aff061ccd0c458c153ecc77">SPH::Array::getCapacity</a></div><div class="ttdeci">int getCapacity() const</div><div class="ttdef"><b>Definition:</b> array.h:306</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_ad7c9b9b534c675d9f29c7a0e8b810e72"><div class="ttname"><a href="class_s_p_h_1_1_array.html#ad7c9b9b534c675d9f29c7a0e8b810e72">SPH::Array::capacity_</a></div><div class="ttdeci">int capacity_</div><div class="ttdef"><b>Definition:</b> array.h:33</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a5c36b90a0b559e69c7850e7791794b0f"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a5c36b90a0b559e69c7850e7791794b0f">SPH::Array::operator[]</a></div><div class="ttdeci">T &amp; operator[](int aIndex) const</div><div class="ttdoc">Get the array element at a specified index. This overloaded operator can be used both to set and get ...</div><div class="ttdef"><b>Definition:</b> array.h:125</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_ae176d3ae769c879d7be41391c0f34eb6"><div class="ttname"><a href="class_s_p_h_1_1_array.html#ae176d3ae769c879d7be41391c0f34eb6">SPH::Array::append</a></div><div class="ttdeci">int append(const Array&lt; T &gt; &amp;aArray)</div><div class="ttdoc">Append an array of values. </div><div class="ttdef"><b>Definition:</b> array.h:409</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a55ade44554c3fd36477ffd67c18bcc41"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a55ade44554c3fd36477ffd67c18bcc41">SPH::Array::operator==</a></div><div class="ttdeci">bool operator==(const Array&lt; T &gt; &amp;aArray) const</div><div class="ttdoc">Determine if two arrays are equal. </div><div class="ttdef"><b>Definition:</b> array.h:161</div></div>
<div class="ttc" id="namespace_s_p_h_html"><div class="ttname"><a href="namespace_s_p_h.html">SPH</a></div><div class="ttdef"><b>Definition:</b> base_body_supplementary.cpp:11</div></div>
<div class="ttc" id="class_s_p_h_1_1_array_html_a79679d423f2d29a81f871c33f5461585"><div class="ttname"><a href="class_s_p_h_1_1_array.html#a79679d423f2d29a81f871c33f5461585">SPH::Array::operator=</a></div><div class="ttdeci">Array&lt; T &gt; &amp; operator=(const Array&lt; T &gt; &amp;aArray)</div><div class="ttdoc">Assign this array to a specified array. This operator makes a complete copy of the specified array; a...</div><div class="ttdef"><b>Definition:</b> array.h:137</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
